import { patch } from './vnode/patch'
import Watcher from './observer/watcher'
import { nextTick } from "./utils";
export function lifecircleMixin(Vue){
      Vue.prototype._update = function(vnode){
          // 根据虚拟dom生成真实dom
          const vm = this
          vm.$el = patch(vm.$el,vnode)
      }
      Vue.prototype.$nextTick = nextTick
}

export function mountComponent(vm,el){
    function updateComp(){
       vm._update(vm._render())
    }
    new Watcher(vm,updateComp,()=>{},true)
}